package ui;

import java.awt.CardLayout;
import java.awt.Font;

import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.FontUIResource;

public class ScreenWB extends JFrame {

	public static final String MAINMENU = "MAINMENU";
	public static final String CUSTOMERLOGIN = "CUSTOMERLOGIN";
	public static final String CUSTOMERMENU = "CUSTOMERMENU";
	public static final String VIEWBALANCE = "VIEWBALANCE";
	public static final String WITHDRAWCASH = "WITHDRAWCASH";
	public static final String DEPOSITFUNDS = "DEPOSITFUNDS";
	public static final String DEPOSITFUNDSMENU = "DEPOSITFUNDSMENU";
	public static final String DEPOSITFUNDSSPENDING = "DEPOSITFUNDSSPENDING";
	public static final String WITHDRAWCASHMENU = "WITHDRAWCASHMENU";
	

	private JPanel contentPane;
	private CustomerLogin customerLogin;
	private CustomerMenu customerMenu;
	private ViewBalance viewBalance;
	private WithdrawCash withdrawCash;
	private DepositFundsMenu depositFundsMenu;
	private DepositFundsSpending depositFundsSpending;
	private WithdrawCashMenu withdrawCashMenu;

	private CardLayout c;

	// public static void main(String[] args) {
	// EventQueue.invokeLater(new Runnable() {
	// public void run() {
	// try {
	// Screen frame = new Screen();
	// frame.setVisible(true);
	// } catch (Exception e) {
	// e.printStackTrace();
	// }
	// }
	// });
	// }

	public ScreenWB() {
		super("ATMS Customer");
		setBackground(UIManager
				.getColor("TabbedPane.selectedTabTitlePressedColor"));
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 735, 500);
		contentPane = new JPanel();
		contentPane.setBackground(UIManager
				.getColor("TabbedPane.selectedTabTitlePressedColor"));
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new CardLayout(0, 0));

		customerLogin = new CustomerLogin();
		contentPane.add(customerLogin, "CUSTOMERLOGIN");

		customerMenu = new CustomerMenu();
		contentPane.add(customerMenu, "CUSTOMERMENU");

		viewBalance = new ViewBalance();
		contentPane.add(viewBalance, "VIEWBALANCE");

		withdrawCash = new WithdrawCash();
		contentPane.add(withdrawCash, "WITHDRAWCASH");

		depositFundsMenu = new DepositFundsMenu();
		contentPane.add(depositFundsMenu, "DEPOSITFUNDSMENU");
		
		withdrawCashMenu = new WithdrawCashMenu();
		contentPane.add(withdrawCashMenu, "WITHDRAWCASHMENU");

		depositFundsSpending = new DepositFundsSpending();
		contentPane.add(depositFundsSpending, "DEPOSITFUNDSSPENDING");

		c = (CardLayout) getContentPane().getLayout();

	}

	public void showMessage(String message) {
		UIManager.put("OptionPane.messageFont", new FontUIResource(new Font(
				"Eurostile", Font.PLAIN, 12)));
		JOptionPane.showMessageDialog(this, message);

	}

	public double getInputDouble(String message) {
		UIManager.put("OptionPane.messageFont", new FontUIResource(new Font(
				"Eurostile", Font.PLAIN, 12)));
		double quart = Double.parseDouble((JOptionPane.showInputDialog(this,
				message).toString()));

		return quart;
	}

	public DepositFundsMenu getDepositFundsMenu() {
		return depositFundsMenu;
	}
	public WithdrawCashMenu getWithdrawCashMenu() {
		return withdrawCashMenu;
	}

	public DepositFundsSpending getDepositFundsSpending() {
		return depositFundsSpending;
	}

	public WithdrawCash getWithdrawCash() {
		return withdrawCash;
	}

	public ViewBalance getViewBalance() {
		return viewBalance;
	}

	public CustomerMenu getCustomerMenu() {
		return customerMenu;
	}

	public CustomerLogin getCustomerLogin() {
		return customerLogin;
	}

	// method showing our Screen
	public void Show(String card) {
		c.show(this.getContentPane(), card);
	}

}
